<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
	<head>
		<title>科目列表</title>
		<script type="text/javascript">
		$(function(){
			$(".subject").click(function(){
				var id = $(this).val();
				if(confirm("是否确认删除？")){
					window.location.href='subjectDelete/'+id;
				}else{
					return;
				}
			});
			
		});
		</script>
	</head>

	<body>
		<div id="messageDiv">
			<c:if test="${not empty message }">
				<script type="text/javascript">
					alert("${message}");
				</script>
			</c:if>
		</div>
		<div class="page-content-area">
			<div class="page-header">
				<a href="subjectChangeLocale?localeType=en_US"><button type="button" class="btn btn-xs btn-default"><spring:message code="page.subject.index.english"/></button></a>
				<a href="subjectChangeLocale?localeType=zh_CN"><button type="button" class="btn btn-xs btn-default"><spring:message code="page.subject.index.chinese"/></button></a>
			</div><!-- /.page-header -->

			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<div class="row">
						<div class="col-xs-12">
							<table id="sample-table-1" class="table table-striped table-bordered table-hover">
								<thead>
									<tr>
										<th width=50>
											<button type="button" class="btn btn-xs btn-success" onclick="window.location.href='subjectAdd'">
			                                	<i class="ace-icon fa fa-plus bigger-120"></i>
			                                </button>
		                                </th>
										<th class="center">
											<label class="position-relative">
												<input type="checkbox" class="ace" />
												<span class="lbl"></span>
											</label>
										</th>
                                                 <th><spring:message code="subject.id.message"/></th>
									    <th><spring:message code="subject.name.message"/></th>
									    <th><spring:message code="subject.description.message"/></th>
									    <th><spring:message code="subject.testCount.message"/></th>
									    <th><spring:message code="subject.totalTime.message"/></th>
									    <th><spring:message code="subject.totalScore.message"/></th>
									    <th><spring:message code="subject.status.message"/></th>
									    <th><spring:message code="subject.action.message"/></th>
                                         	</tr>
								</thead>

								<tbody>
                                         <c:forEach items="${subjectList }" var="subject">
                                             <tr>
                                             		<td></td>
                                                     <td class="center">
                                                         <label class="position-relative">
                                                             <input type="checkbox" class="ace" />
                                                             <span class="lbl"></span>
                                                         </label>
                                                     </td>
                                                     <td>${subject.subId }</td>
                                                     <td>${subject.name }</td>
                                                     <td>${subject.description }</td>
                                                     <td>${subject.testCount }</td>
                                                     <td>${subject.totalTime }</td>
                                                     <td>${subject.totalScore }</td>
                                                     <td>${subject.status }</td>
										<td>
											<button class="btn btn-xs btn-info" onclick="window.location.href='subjectEdit/${subject.subId }'">
												<i class="ace-icon fa fa-pencil bigger-120"></i>
											</button>

											<button class="btn btn-xs btn-danger subject" value="${subject.subId }">
												<i class="ace-icon fa fa-trash-o bigger-120"></i>
											</button>
										</td>
									</tr>
								</c:forEach>
								</tbody>
							</table>
						</div><!-- /.span -->
					</div><!-- /.row -->

					<div class="hr hr-18 dotted hr-double"></div>
				</div><!-- /.col -->
			</div><!-- /.row -->
		</div><!-- /.page-content-area -->
	</body>
</html>
